
#pragma once

#include <assert.h>
#include <gl/glew.h>
#include <string>
using namespace std;

#include "GlobalTypes.h"


struct VertexAttribDescr
{
	GLuint attribId;
	GLuint componentCount;
	GLuint type;
	GLuint drawMode;
};

struct VertexBufferDescr
{
	GLuint vertexAttribsCount;
	VertexAttribDescr* vertexDescrPtr;
	GLuint vertexCount;
};

class VertexBuffer
{
public:
	VertexBuffer(VertexBufferDescr& vbDescr);

	void setBufferAttribData(GLuint attribId, void* data, GLuint count);
	//void draw();

	//
	VertexBufferDescr& getVertexBufferDescr() { return _vbDescr; }
	char* getDataWithAttribId(int attribId);

private:
	char** _buffer;
	int _attribsCount;
	int _vertexCount;
	int _vertexUsed;

	//GLuint _vao;
	//GLuint* _vbo;
	//GLuint _primitiveType;

	VertexBufferDescr _vbDescr;
};
